#! /bin/sh
# chkconfig: 2345 10 90 
# description: caiyun ....
# This script will be executed *after* all the other init scripts.  
# You can put your own initialization stuff in here if you don't  
# want to do the full Sys V style init stuff.  
#prefix=/home/XXX/XXX
#nohup $prefix/start_XXX.sh >> $prefix/XXX.log 2>&1 &
CAIYUN_ROOT=/root/caiyun
CAIYUNFILENAME=ADCSmsOrderServer.war

#停止方法
stop(){
    echo "Stoping $彩云数据同步 "
	ps -ef|grep $CAIYUNFILENAME |awk '{print $2}'|while read pid
	do
	   kill -9 $pid
	   echo " $pid kill"
	done
}

case "$1" in
start)
    echo "Starting $彩云数据同步 "
	nohup java -jar ADCSmsOrderServer.jar 1>nohup.out 2>&1 &
  ;;
stop)
  stop
  ;;
restart)
  stop
  start
  ;;
status)
  ps -ef|grep $CAIYUNFILENAME
  ;;
*)
  printf 'Usage: %s {start|stop|restart|status}\n' "$prog"
  exit 1
  ;;
esac